package com.lq.tech.infra;

import com.lq.tech.infra.ErrorCode;

public class CopperException extends RuntimeException{

	/**
	 *
	 */
	private static final long serialVersionUID = 2368925481129834020L;

	/**
	 * 异常码
	 */
	private int code;

	private Object value;

	public CopperException(String message){
		super(message);
	}
	public CopperException(int code,String message){
		super(message);
		this.code=code;
	}

	public CopperException(ErrorCode errorCode) {
		super(errorCode.getDesc());
		this.code=errorCode.getCode();
	}
	public CopperException(ErrorCode errorCode,Object value) {
		this(errorCode);
		this.value=value;
	}
	public CopperException(ErrorCode errorCode,Object value,Throwable cause) {
		super(errorCode.getDesc(),cause);
		this.code=errorCode.getCode();
		this.value=value;
	}

	public int getCode() {
		return code;
	}

	public Object getValue() {
		return value;
	}
}
